package org.zlb.manager.entity;

import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Objects;

/**
 * TODO
 *
 * @author zhoulingbo
 * @date 2021/8/10 12:30
 */
public class OrgDeptRulePK implements Serializable {
    private long deptId;
    private String menuCode;

    @Column(name = "DEPT_ID")
    @Id
    public long getDeptId() {
        return deptId;
    }

    public void setDeptId(long deptId) {
        this.deptId = deptId;
    }

    @Column(name = "MENU_CODE")
    @Id
    public String getMenuCode() {
        return menuCode;
    }

    public void setMenuCode(String menuCode) {
        this.menuCode = menuCode;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OrgDeptRulePK that = (OrgDeptRulePK) o;
        return deptId == that.deptId &&
                Objects.equals(menuCode, that.menuCode);
    }

    @Override
    public int hashCode() {
        return Objects.hash(deptId, menuCode);
    }
}
